<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8"/>
        <title>LeanEngine Slim 3 TODO Demo</title>
        <link href='/stylesheets/bootstrap.min.css' rel='stylesheet' type='text/css'>
        <link href='/stylesheets/style.css' rel='stylesheet' type='text/css'>
    </head>
    <body>
        <?php include 'nav.phtml' ?>

        <div class="container">
            <h1>用户注册</h1>
            <?php if(isset($error)): ?>
            <div class="alert alert-danger" role="alert">
                <strong>注册失败：</strong><?= htmlspecialchars($error->getMessage()) ?>
            </div>
            <?php endif; ?>
            <form class="form-horizontal" method="POST" action="/register">
                <div class="form-group">
                    <label for="inputName" class="col-sm-2 control-label">用户名</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="inputName" name="name" placeholder="用户名">
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputPassword" class="col-sm-2 control-label">密码</label>
                    <div class="col-sm-10">
                        <input type="password" class="form-control" id="inputPassword" name="password" placeholder="密码">
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-default">登录</button>
                    </div>
                </div>
            </form>
        </div>
    </body>
</html>
